home *** CD-ROM | disk | FTP | other *** search
- Path: news.bellglobal.com!stupy
- From: stupy@freenet.durham.org (Steve Tupy)
- Newsgroups: comp.lang.c
- Subject: Re: What will happen close to 640K limit ?
- Date: 29 Jan 1996 14:57:47 GMT
- Organization: Durham Free-Net
- Message-ID: <4ein9b$330@news.bellglobal.com>
- References: <Pine.SOL.3.91.960128110843.26154C-100000@hamlet.uncg.edu>
- NNTP-Posting-Host: 204.101.165.17
- X-Newsreader: TIN [version 1.2 PL2]
-
- : I wrote a DOS program, with size about 512K, which is the size when I use
- : dir to check it.
- :
- This may not be totally reliable...
-
- : I also use dos command mem to check dos avaible memory, which gave me max
- : execute file size 560k, because there are some device driver I load in
- : the config.sys, I knew 512k is not real program size, there are some
- : stack variable and memory allocated on heap.
-
- : Now my program is not stable, it can work for fine for couple days, then
- : it lock up. It may just lock up keyboard or screen, it may also reboot
- : PC, I wonder if because it close to 640 K limit ? How can I check the real
- : program size include stack size and heap ?
-
- Because DOS is not reentrant, if you intend to run it for any length
- of time WITH memory allocation/deallocation, you almost MUST implement some
- sort of garbage collection scheme to "defrag" your memory segments. This is
- why you see all these BBS packages dumping out of memory and loading up
- again from the command line, it flushes the memory back to the original
- point, in a manner of speaking. You can either avoid memory allocation,
- implement a garbage collector or reload your program from time to time,
- these are about the only ways to deal with this problem that I know of...
-
- Take care!
-
- --
- Steve
-